//-------------------------------------------------------------------
//	Copyright (c) 2010-2012  Zhirnov Andrey
//	This file is part of the "UXGEN" project.
//	See copyright notice in "Engine.h".
//-------------------------------------------------------------------

#ifndef _UX_ENGINE_TYPES_H
#define _UX_ENGINE_TYPES_H

#include "../Defines/Defines.h"
#include "../Enums/Enums.h"
#include "BaseObject.h"
#include _UX_STL_EXT_PATH_

namespace Engine
{
namespace UXTypes
{


	//
	// Render Init Params
	//

	struct TRenderInitParams
	{
		UXMath::uvec2			vSize;
		UXMath::ivec2			vPos;
		e_wnd_style::type		eStyle;
		uint8					uFreq;	// for full screen mode
		bool					bFullScreen;

		e_glinit_flags::type	eFlags;
		uint8					uMSAASamples,		// Multisample Anti-Aliasing samples count or Coverage Samples (1..32)
								uColorSamples,		// Color Samples for CSAA (1..16)
								uColorBits,			// 24 or 32
								uDepthBits,			// 16, 24, 32
								uStencilBits;		// 0, 8
		bool					bVSync;
		///
		TRenderInitParams():
			eFlags(e_glinit_flags::DEFAULT), uMSAASamples(0), uColorSamples(0), uColorBits(32),
			uDepthBits(24), uStencilBits(0), bVSync(false), vSize(640,480), vPos(0,0),
			eStyle(e_wnd_style::DEF_WINDOWED), uFreq(0), bFullScreen(false) {}
	};



	//
	// Sound Init Params
	//

	struct TAudioInitParams
	{
		string	sAudioDevice;
		uint	uAUXSlots;
		///
		explicit
		TAudioInitParams(const char *audio_device = nullptr, uint slots = 4):
			sAudioDevice(audio_device), uAUXSlots(slots) {}
	};


	//
	// OpenCL Init Params
	//

	struct TOpenCLInitParams
	{
		string	sDeviceName;
		bool	bShareWithGL;
		///
		explicit
		TOpenCLInitParams(	const char *	p_opencl_device	= nullptr,
							bool			b_share_with_gl	= true ):
			sDeviceName(p_opencl_device), bShareWithGL(b_share_with_gl) {}
	};


	//
	// Engine Extended Params
	//

	struct TEngExtParams
	{
		string					sResDirectory;
		e_log_msg::type			eLogFilter;
		e_resman_flags::type	eResManFlags;
		uint8					uLogLevel;
		///
		TEngExtParams():
			sResDirectory("data"), eResManFlags(e_resman_flags::FREE_NON_REF | e_resman_flags::SET_DEFAUL_RES),
			eLogFilter(e_log_msg::FILTER_ALL), uLogLevel(16) {}
	};


	//
	// Splash Window and Icon
	//

	struct TSplashAndIcon
	{
		string					sImage,
								sIcon;
		uvec2					vSize;
		///
		TSplashAndIcon() {}
	};



	//
	// Engine Init Params
	//

	struct TEngInitParams
	{
		void				*	pIcon;		// HICON for Windows
		string					sClassName,
								sApplicationName;
		uint					uLoadThreads,
								uRenderThreads,
								uWindows,
								uMaxThreads;
		TSplashAndIcon			sSplash;
		TRenderInitParams		sRenParams;
		TAudioInitParams		sAudioParams;
		TOpenCLInitParams		sCLParams;
		TEngExtParams			sExtParams;
		///
		explicit
		TEngInitParams( const char				*	p_app_name		= nullptr,
						const TRenderInitParams	&	s_ren_params	= TRenderInitParams(),
						const TAudioInitParams	&	s_audio_init	= TAudioInitParams(),
						const TOpenCLInitParams	&	s_cl_params		= TOpenCLInitParams(),
						const TEngExtParams		&	s_ext_params	= TEngExtParams(),
						const TSplashAndIcon	&	s_splash		= TSplashAndIcon(),
						uint						u_load_threads	= 0,
						uint						u_render_threads= 0,
						uint						u_windows		= 0,
						uint						u_max_threads		= 0,
						void					*	p_icon			= nullptr,
						const char				*	p_class_name	= nullptr):
			sClassName(p_class_name), sApplicationName(p_app_name), sRenParams(s_ren_params),
			pIcon(p_icon), sAudioParams(s_audio_init), uLoadThreads(u_load_threads),
			sCLParams(s_cl_params), sExtParams(s_ext_params), uRenderThreads(u_render_threads),
			uWindows(u_windows), sSplash(s_splash), uMaxThreads(u_max_threads)
		{}
	};

//-------------------------------------------------------------------

}	// UXTypes
}	// Engine

#endif	// _UX_ENGINE_TYPES_H